Tutorials
The goal of this tutorial is to create a simple installer for a fictional product named "Advantage". The "Advantage" product consists of an application, a system extension, and several other associated files. It is to be installed inside of a folder named "Advantage 1.0" on the user's drive.
The first step in building any installer is to identity the files that will be part of the installer. For this tutorial, this step has already been done. There is a folder named "Advantage 1.0" inside the "Tutorial Files" folder which contains all files needed for this first tutorial.
The next step in building an installer is to create a script using the DragInstall Builder application. This tutorial takes advantage of the DragInstall "QuickScript" feature to create a complete script document in a matter of minutes.
- Launch the Builder application inside your DragInstall folder.
- From the File menu, choose "New QuickScript...".
- Select the folder named "Advantage 1.0" within the "Tutorial Files" folder.
The "New QuickScript" option takes a folder on your drive and creates a new script document based on this folder. All files inside the folder are added to the script and assigned to an installation that is named the same as the folder. If there are any files inside your folder that are normally installed into the System Folder, then these files are moved into the appropriate folders. If there is a Read Me file within your folder, this file's text is used as the Read Me text for your installer.
The decisions made by the QuickScript option in assembling a script document are not final. Once the script document is created, you can further customize it before you build your final installer.
Click OK to dismiss the Quick Script Results window. You should see a newly created script window.
The left side of the script window shows the items that are part of your installer. These include folders and files as well as other special items that will be covered in the next tutorial. Notice that the items from the "Advantage 1.0" folder have been placed into the script, except for the "Advantage Startup" file, a system extension which has been moved into the Active Extensions folder.
The right side of the script window lists the installation options that are part of your installer. The script you just created contains only one installation option named "Advantage 1.0". DragInstall can have any number of installation options and each can be classified as either a Recommended or Custom option. In this script, the "Advantage 1.0" installation is a Recommended option.
The checkboxes along the left side of the item view indicate whether an item belongs to the selected installation on the right. Notice that all of the items from the folder that you selected have been automatically assigned to the "Advantage 1.0" installation.
You are now ready to build your first installer. This installer will be a basic one right now, but it will become more sophisticated in the next tutorial.
- From the File menu, choose Save.
- Name the script "Advantage Script". Save in the DragInstall folder.
- From the File menu, choose Build Installer.
- Click Continue to accept the default options for building.
- Name the installer "Advantage Installer" and save it into the DragInstall folder.
If the build was successful, you will see a final dialog indicating how many files were compressed and how much space was saved. If you encountered any problems building, refer to the Troubleshooting section.
That's it. You can now try your first installer out.
- From the File menu, choose Quit. Save changes.
- Launch the file "Advantage Installer".
- Drag the icon "Advantage 1.0" onto any hard disk icon within the installer window.
The folder "Advantage 1.0" should be installed at the root level of your hard disk, and the file "Advantage Startup" should be installed into the Extensions folder on your startup disk. (Don't worry, this extension doesn't do anything, and it will be deleted in Tutorial 2.)
The goal of this tutorial is to extend the simple installer created in the first tutorial. The following enhancements will be made to the installer during the course of this tutorial:
The graphics files in the installer will be installed based on system rules.
Additional custom installation options will be created.
An "uninstall" option will be added.
The installer will be "spruced" up with a new splash screen and some other customizations.
If you worked through the first tutorial, you should have a script document named "Advantage Script" on your hard disk. You will need to open this script to begin this tutorial. If you didn't go through the first tutorial, you can open the file "Advatange Script" found inside the "Tutorial Files" folder.
The installer created in the first tutorial was a simple one. The items in the "Advantage Script" were not changed from their default attributes. In this tutorial, we will assign a System Rule to two of the items in the script.
In the "Advantage 1.0" folder there is a "Graphics" folder containing two files "Black & White" and "Color". Suppose that we only want the file "Black & White" to be installed on systems with black & white monitors and the file "Color" to be installed only on color systems. We can accomplish this easily.
- Click twice on the file item named "Black & White". This opens the File Info window for editing the item's attributes.
- In the tabbed folder view near the bottom of the window, click on the Set... button to open the System Rules window.
- Change the "Color" popup menu to "Install if not present". Click the Change button. This rule should be added to the Rules list within the item's Info window.
- Click the Change button in the Info window to update the script document. Note that the information for the selected item at the bottom of the script window has been updated to reflect the new rule.
- Repeat the above steps for the file item named "Color", except change the "Color" popup menu in the System Rules window to "Install if present".
If you were to build and run an installer at this point, you would see only one of the "Graphics" files get installed based on whether or not your machine had color. The installer would check the file rules against the machine's configuration and install the appropriate file.
The installer created in the first tutorial contained a single recommended installation with all files from the "Advantage 1.0" folder. In this tutorial, we will create additional installation options for installing portions of the "Advantage 1.0" folder.
First, we will create separate installation options for the Advantage extension and the Advantage application. This can be done in a couple of steps.
- Click once to select the file item named "Advantage Startup" in your script.
- Hold the shift key down and click once on the file item named "Advantage 1.0". This results in both items being selected.
- From the Item menu, choose "Make into Multiple Installations".
You should see two new options in the installation view on the right side of the script window named "Advantage Startup" and "Advantage". If you click on either option, you will see the check marks change in the item view indicating which items are assigned to each installation.
The user will see the "Advantage Startup" and "Advantage" icons in the Custom "page" of your installer window. These options will allow them to install the Advantage application and extension separately.
Next, we will create a separate installation for the "Graphics" folder inside the Advantage folder.
- Click once to select the folder item named "Graphics" in your script.
- From the Edit menu, choose "Select Folder". This selects the "Graphics" folder and its contents.
- From the Item menu, choose "Make into One Installation".
This creates a new installation option named "Graphics" (the name of the selected folder) and automatically assigns all selected items to this installation. This option would also be presented to the end user on the Custom "page" of the installer window. This can be changed in the Installation Editor window if desired.
So far in this tutorial, we've added some additional installation options for the user. Now we're going to add an "uninstall" option. This requires three steps. The first is to create a new installation, the second is to add some items to our script, and the third is to assign those items to the new installation.
To create the new "uninstall" installation, do the following:
- From the Script menu, choose "New Installation...". This creates a new installation and opens the Installation Editor window to set its attributes.
- Change the Name field from "New Installation" to "Uninstall Advantage" and click the Recommended checkbox.
- Click the Create button to add the installation to the script document.
Since we set this new installation as "Recommended", the user will see this option on the first "page" of the installer window, along with the "Advantage 1.0" installation.
Now we have to add the script items to peform the uninstall. We need to delete the "Advantage Startup" extension and also the "Advantage 1.0" folder. We will assume that the extension will be in the Extensions folder, but we will allow for the possibility that the "Advantage 1.0" folder has been moved from the root of the user's drive.
To take care of deleting the extension, do the following:
Click once to select the "Extensions" folder inside the "Active System Folder".
From the Script menu, choose "New Item:Delete". This creates a new Delete script item and opens its Info window.
Enter the name "Advantage Startup" as the name of the file to delete.
Click Create to add the Delete item to the script.
To take care of deleting the Advantage 1.0 folder", do the following:
- Click once to select the "User's Macintosh" item at the top of the item view.
- From the Script menu, choose "New Item:Find". This creates a new Find script item and opens its Info window.
- Change the Locate popup menu to "Folder by Name". Enter the name Advantage 1.0 as the name of the folder to find.
- Click Create to add the Find item to the script.
- Now, from the Script menu, choose "New Item:Delete". This creates another Delete item and opens its Info window.
- Change the Delete popup menu to "Folder by Name". Enter the name Advantage 1.0 as the name of the folder to delete.
- Click Create to add the Delete item to the script.
The two items that were added to the script will operate as follows. The Find item searches the user's drive for a folder named "Advantage 1.0". If the search is successful, the current install location is set to the folder containing the Advantage 1.0 folder. The Delete item then looks for a folder named "Advantage 1.0" within the current install location and deletes the folder and its contents if it is found. If the Find is not successful, the Delete doesn't find a folder to delete and nothing happens.
If we wanted to tell the user that the "Advantage 1.0" folder could not be found, we could use a Message item to accomplish this. To add this Message item, do the following:
- Make sure that the Delete folder item is still selected. We want to add the Message item after this item.
- From the Script menu, choose "New Item:Message". This creates a Message item and opens its Info window.
- Enter the following text into the Message field: The folder named "Advantage 1.0" could not be found and was not uninstalled.
This message should only appear when the Find item could not locate the "Advantage 1.0" folder. To do this, we will need to test the results of the previous Find using a Result Test.
- In the Message Info window, click the tab named "Results" in the attributes area.
- Click the New... button to create a Result Test.
- In the Result Test window, choose "Last Find Was Not Successful" from the popup menu.
- Click Create to add this test to the Result Test list.
- Click Create to add the Message item to the script.
The info area at the bottom of the script window should show the settings for the new Message item, including the "Last Find Was Not Successful" test. This means that this message will only be displayed if the "Advantage 1.0" folder could not be found.
The only thing left to do to complete the Uninstall option is to assign these new items to the Uninstall installation. To do this, make sure that the installation named "Uninstall" is selected in the installation view. Then click the checkboxes for all of the items just entered: the Delete item in the Extensions folder and the Find, Delete, and Message items at the end of the script.
Additional Customizations
Our new installer is almost ready. We just want to make a couple of quick enhancements, and then we'll be ready to build. We are going to customize the startup screen and make some changes to the appearance of the installer window before we build.
- From the Script menu, choose Startup Screen. This opens up the Startup Screen editor window.
- From your Apple menu, open your Scrapbook. Flip though until you find a picture that you would like for your installer's startup screen. Copy the picture using the Scrapbook's Edit menu.
- Close the scrapbook and paste the picture into the Black & White picture field of the editor window.
- Click the Change button to save these changes to the document.
- From the Script menu, choose "Installer Appearance...". This opens up the Appearance Options window.
- Change the color of the installer window to the color of your choice, and select your favorite progress cursor.
- Click Change to save these changes to the document.
You are now ready to build your second installer.
- From the File menu, choose Save. This will saves the script document to disk.
- From the File menu, choose Build Installer.
- Click Continue to accept the default options for building.
- Name the installer "New Advantage Installer" and save it into the DragInstall folder.
If the build was successful, you will see a final dialog indicating how many files were compressed and how much space was saved. If you encountered any problems building, refer to the Troubleshooting section.
That's it. Now you can try your second installer out.
- From the File menu, choose Quit. Save changes.
- Launch the file "New Advantage Installer".
- Drag some of the installation icons over to your hard disk to see what happens.
A script is a document created by the DragInstall Builder.
It is not a script in the programming sense, rather it is a collection of the items, installations, and other attributes which define an installer.
[Contents | Contact Information]
Last modified 26-MAR-96
Copyright © 1996 Ray Sauers Associates, Inc.